<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" import="java.text.SimpleDateFormat"
         errorPage="" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ page isELIgnored="false" %>
<%@ include file="/interceptor.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>修改信息页面</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
   <script type="text/javascript">
        function setit() {
            var dname = document.getElementById("dname").value;
            var color = document.getElementById("color").value;
            var creat_time = document.getElementById("creat_time").value;
            var shell_time = document.getElementById("shell_time").value;
            var picture = document.getElementById("picture").value;
            if (dname == null || dname == "") {
                alert("用户名不能为空！");
                return false;
            } else if (color == null || color == "") {
                alert("颜色不能为空！");
                return false;
            } else if (creat_time == null || creat_time == "") {
                alert("创建时间不能为空！");
                return false;
            } else if (shell_time == null || shell_time == "") {
                alert("出售时间不能为空！");
                return false;
            } else if (confirm("您确定要保存数据吗？")) {
                document.forms[0].submit();
            }
        }

        function back() {
            history.go(-1);
        }
    </script>
</head>

<body>

<form id="myForm" name="myForm" action="computerupdate" method="post">
    <div class="action">
        <div class="t">修改信息</div>
        <div class="pages">
            <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="right" width="30%">ID：</td>
                    <td align="left"><input type="text" name="id"  id="id" value="${computer.id}"/></td>
                </tr>
                <tr>
                    <td align="right" width="30%">名称：</td>
                    <td align="left"><input type="text" name="dname" id="dname" value="${computer.dname}"/></td>
                </tr>
                <tr>
                    <td align="right" width="30%">颜色：</td>
                    <td align="left"><input type="text" name="color"  id="color" value="${computer.color}"/> </td>
                </tr>
                <tr>
                    <td align="right" width="30%">生产日期：</td>
                    <td align="left"><input type="text" name="creat_time"  id="creat_time" value="${computer.creat_time}"/></td>
                </tr>
                <tr>
                    <td align="right" width="30%">出售时间：</td>
                    <td align="left"><input type="text" name="shell_time"  id="shell_time" value="${computer.shell_time}"/></td>
                </tr>
                <tr>
                    <td align="right" width="30%">图片路径：</td>
                    <td align="left"><input type="text" name="picture"  id="picture" value="${computer.creat_time}"/></td>
                </tr>
                <tr >
                    <td align="center" colspan="2"><br/>
                        <input type="button"  id="update" value="修改数据" onclick="setit();"/>
                        <input type="button"  id="re_to" value="返回" onclick="back();" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
</body>
</html>